using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using Model.Database;

namespace Model.Mapping
{
    public class LoginoutMap : EntityTypeConfiguration<Loginout>
    {
        public LoginoutMap()
        {
            // Primary Key
            this.HasKey(t => t.LoginoutId);

            // Properties
            this.Property(t => t.LoginoutId)
                .IsRequired()
                .HasMaxLength(32);

            this.Property(t => t.UserInfoId)
                .IsRequired()
                .HasMaxLength(32);

            this.Property(t => t.ActionType)
                .IsRequired()
                .HasMaxLength(10);

            this.Property(t => t.Ip)
                .HasMaxLength(25);

            this.Property(t => t.Description)
                .HasMaxLength(25);

            // Table & Column Mappings
            this.ToTable("Loginout");
            this.Property(t => t.LoginoutId).HasColumnName("LoginoutId");
            this.Property(t => t.UserInfoId).HasColumnName("UserInfoId");
            this.Property(t => t.ActionType).HasColumnName("ActionType");
            this.Property(t => t.Ip).HasColumnName("Ip");
            this.Property(t => t.Description).HasColumnName("Description");
            this.Property(t => t.AddTime).HasColumnName("AddTime");
            this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
        }
    }
}
